-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow the setHash option to be overridden on a per atom set basis #35
allow the setHash option to be overridden on a per atom set basis #35
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
dcca0d7
to
1c137c6
Compare
@Flirre any thoughts on this? the second argument is a little weird but i thought it was better than trying to change the main state parameter, wdyt? |
@scamden What do you think? |
i like this! and didn't realize atomWithLocation has similar pattern! also allows for adding future options (although maybe that's unlikely.) I'll make the change and push again |
1c137c6
to
cfd6e4f
Compare
@Flirre made those changes! could you TAL again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only minor comments left, then I think it's ready for a merge!
cfd6e4f
to
8ef0c7e
Compare
@Flirre can we merge? i'm using a copy and pasted version of this in our code base until we get his in haha |
This PR allows you to change how the hash is modified when you set the atom value itself instead of only being able to choose on atom creation. This is useful for things like replacing while initializing a set of atoms but then push for later changes. I added a test to check the functionality but also as an example of the use case.
I also added a debug jest script to package.json cause I find it useful but I can remove if you don't want that.